package com.vinfai.demo.dao.impl;

import org.hibernate.SessionFactory;

import org.springframework.stereotype.Repository;

import com.vinfai.common.dao.impl.HibernateBaseDAOImpl;
import com.vinfai.demo.dao.IUserDAO;
import com.vinfai.hibernate4.entity.User;

@Repository("UserDAO")
public class UserDAO extends HibernateBaseDAOImpl<User, java.lang.Long> implements IUserDAO{
	
	public UserDAO(){
		
	}
	public UserDAO(SessionFactory sessionFactory,Class entityClazz){
		this.sessionFactory = sessionFactory;
		this.entityClazz = entityClazz;
	}
	
	public void insert(){
		System.out.println(this.getSession());
		System.out.println(this.getSession());
		System.out.println(this.getSession());
		System.out.println(this.getSession());
		User user = new User();
		user.setName("user1");
		user.setLoginName("user1");
		user.setPassword("user1");
		this.getSession().save(user);
		User user2 = new User();
		user2.setName("user1");
		user2.setLoginName("user1");
		this.getSession().save(user2);
	}
}
